﻿using System;
using System.Collections;
using System.Drawing;
using System.Web;
using System.Web.Profile;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;

public partial class Admin_Main :MasterPage //System.Web.UI.Page
{
    protected void Bind()
    {
        //this.LogoImg.ImageUrl = "Images/Logo.jpg";
        //string filePath = base.Server.MapPath("Images/Logo.jpg");
        //string str2 = base.Server.MapPath("Images/LoginBg.jpg");
        //this.SrLink.NavigateUrl = "http://www.16395.net/";
        //this.SrLink.Target = "_blank";
        //this.CopyRight.Text = "Powered by <a href=\"http://www.16395.net/\">DDI</a> Version 2007 &copy;2006-2008 点点信息.";
        //if ((FSO.FileSize(filePath) != "9206") || (FSO.FileSize(str2) != "42740"))
        //{
        //    ClientScriptManager clientScript = this.Page.ClientScript;
        //    string str3 = "AlertD(提示','您所使用的系统已经被第三方修改，极可能是盗版！<br />请下载正版系统')";
        //    str3 = string.Format("<script language=\"JavaScript\" type=\"text/javascript\" >{0}</script>", str3);
        //    clientScript.RegisterStartupScript(base.GetType(), "alertD", str3);
        //}
    }

    protected void ClearCacheButton_Click(object sender, EventArgs e)
    {
        IDictionaryEnumerator enumerator = base.Cache.GetEnumerator();
        while (enumerator.MoveNext())
        {
            base.Cache.Remove(enumerator.Key.ToString());
        }
        this.ClearCacheButton.Text = "缓存清除成功";
        this.ClearCacheButton.BackColor = Color.Yellow;
    }

    protected void LoginOut_Click(object sender, EventArgs e)
    {
        ManagerLogin.Out();
        base.Server.Transfer("Login.aspx");
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (ManagerLogin.Validate())
        {
            this.UserNameMessage.Text = ((string)base.Session["ManagerName"]) + "&nbsp;您好！";
            if (base.Session["RoleList"] == null)
            {
                ManagerLogin.Out();
            }
            this.MangerRoleId.Value = base.Session["RoleList"].ToString();
            this.IsAdmin.Value = base.Session["IsAdmin"].ToString();
        }
        if (!base.IsPostBack)
        {
            this.Bind();
        }
    }
}
